fix potential pa_range_info out of bound access
authorStefano Stabellini <sstabellini@kernel.org>
Mon, 12 Dec 2016 19:22:39 +0000 (11:22 -0800)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 12 Dec 2016 19:23:16 +0000 (11:23 -0800)
commit7190f2d72441b7e5b32004e48398fa6830dd4d99
tree23982488621346a40fb19cec28d5388d46358db6
parent014723d9b3275d1b840118331fe198e29254d8fa
fix potential pa_range_info out of bound access

pa_range_info has only 8 elements and is accessed using pa_range as
index. pa_range is initialized to 16, potentially causing out of bound
access errors. Fix the issue by checking that pa_range is not greater
than the size of the array. Remove the now superfluous pa_range&0x8
check.

Coverity-ID: 1381865

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/p2m.c